using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class So_DL_StartedWOMap : EntityTypeConfiguration<So_DL_StartedWO>
    {
        public So_DL_StartedWOMap()
        {
            // Primary Key
            this.HasKey(t => new { t.id, t.Status });

            // Properties
            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Order_)
                .HasMaxLength(15);

            this.Property(t => t.Status)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.Physician)
                .HasMaxLength(35);

            this.Property(t => t.Technician)
                .HasMaxLength(50);

            this.Property(t => t.Appliance)
                .HasMaxLength(50);

            this.Property(t => t.Work_type)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("So_DL_StartedWO");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Order_).HasColumnName("Order#");
            this.Property(t => t.Order_date).HasColumnName("Order_date");
            this.Property(t => t.Start_date).HasColumnName("Start_date");
            this.Property(t => t.End_date).HasColumnName("End_date");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.Technician).HasColumnName("Technician");
            this.Property(t => t.Appliance).HasColumnName("Appliance");
            this.Property(t => t.Work_type).HasColumnName("Work_type");
        }
    }
}
